From 178c9c3991271fa94c1b759ac1dbb49d7265058c Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 4 Feb 2009 14:28:13 +0000 Subject: [PATCH] x86: No need to flush TLBs on free_page_type() as we no longer trust the linear pagetable mapping (we use it but we double check it). Signed-off-by: Keir Fraser --- xen/arch/x86/mm.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 6fe26a3468..c867b4ca9a 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -2023,30 +2023,17 @@ int free_page_type(struct page_info *page, unsigned long type, unsigned long gmfn; int rc; - if ( likely(owner != NULL) ) + if ( likely(owner != NULL) && unlikely(paging_mode_enabled(owner)) ) { - /* - * We have to flush before the next use of the linear mapping - * (e.g., update_va_mapping()) or we could end up modifying a page - * that is no longer a page table (and hence screw up ref counts). - */ - if ( current->domain == owner ) - queue_deferred_ops(owner, DOP_FLUSH_ALL_TLBS); - else - flush_tlb_mask(owner->domain_dirty_cpumask); - - if ( unlikely(paging_mode_enabled(owner)) ) - { - /* A page table is dirtied when its type count becomes zero. */ - paging_mark_dirty(owner, page_to_mfn(page)); + /* A page table is dirtied when its type count becomes zero. */ + paging_mark_dirty(owner, page_to_mfn(page)); - if ( shadow_mode_refcounts(owner) ) - return 0; + if ( shadow_mode_refcounts(owner) ) + return 0; - gmfn = mfn_to_gmfn(owner, page_to_mfn(page)); - ASSERT(VALID_M2P(gmfn)); - shadow_remove_all_shadows(owner->vcpu[0], _mfn(gmfn)); - } + gmfn = mfn_to_gmfn(owner, page_to_mfn(page)); + ASSERT(VALID_M2P(gmfn)); + shadow_remove_all_shadows(owner->vcpu[0], _mfn(gmfn)); } if ( !(type & PGT_partial) ) -- 2.30.2